<script setup>
import DetailPanel from '@/components/detail-panel/detail-panel.vue'

import { storeToRefs } from 'pinia'
import useDetailStore from '@/stores/modules/detail'

const detailStore = useDetailStore()
const { getLandlordModule } = storeToRefs(detailStore)
</script>

<template>
  <div class="detail-landlord">
    <DetailPanel title="房东介绍" more="查看房东主页">
      <div class="content">
        <div class="top">
          <img :src="getLandlordModule?.topScroll" alt="" />
        </div>
        <div class="center">
          <div class="left">
            <div class="info">
              <div class="avatar">
                <img :src="getLandlordModule?.hotelLogo" alt="" />
              </div>
              <div class="info-more">
                <div class="name">{{ getLandlordModule?.hotelName }}</div>
                <div class="tags">
                  <template v-for="(item, index) in getLandlordModule?.hotelTags">
                    <span class="item">{{ item.tagText.text }}</span>
                  </template>
                </div>
              </div>
            </div>
          </div>
          <div class="contact">联系房东</div>
        </div>
        <div class="bottom">
          <template v-for="(item, index) in getLandlordModule?.hotelSummary">
            <div class="item">
              <div class="title">{{ item.title }}</div>
              <div class="score">{{ item.introduction }}</div>
              <div class="desc">{{ item.tip }}</div>
            </div>
          </template>
        </div>
      </div>
    </DetailPanel>
  </div>
</template>

<style lang="less" scoped>
.detail-landlord {
  .top {
    img {
      border-radius: 3px;
      width: 100%;
    }
  }
  .center {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
  }
  .info {
    display: flex;
    .avatar {
      margin-right: 5px;
      img {
        width: 54px;
        height: 54px;
      }
    }
  }
  .info-more {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    .name {
      margin-top: 8px;
      font-size: 16px;
      font-weight: 600;
    }
    .tags {
      display: flex;
      margin-top: 5px;
      font-size: 12px;
      color: rgb(155, 155, 155);
      .item {
        line-height: 14px;
        height: 14px;
        text-align: center;
        padding: 0 8px;
        border-right: 1px solid rgb(155, 155, 155);
        &:last-child {
          border-right: 0;
        }
        &:first-child {
          padding-left: 0;
        }
      }
    }
  }
  .contact {
    height: 24px;
    line-height: 24px;
    border-radius: 5px;
    padding: 0 12px;
    font-size: 12px;
    color: #fff;
    background-image: linear-gradient(90deg, #fa8c1d, #fcaf3f);
  }
  .bottom {
    display: flex;
    justify-content: space-between;
    margin: 50px 10px 10px;
    .item {
      font-size: 12px;
      .title {
        color: #999;
      }
      .score {
        margin: 5px 0;
        font-size: 18px;
        font-weight: 700;
        color: #333;
      }
      .desc {
        color: #666;
      }
    }
  }
}
</style>
